Component({
    properties: {
        
    },

    data: {
        count:60,
        start:false
    },

    methods: {
        time(){
            this.setData({ start:true })
            this.clear = setInterval(() => {
                let { count } = this.data
                count --
                this.setData({ count })
                if( count === 0 ){
                    clearInterval(this.clear)
                    this.setData({ start:false })
                }
            }, 1000);
        },
        onTap(){
            if(!this.start){
                this.setData({ count: 60 })
                this.time()
            }
        }
    }
})
